#include "FilterMask.h"

FilterMask::FilterMask(int width, int height, PostProcessingType postProcessing)
{
    Width = width;
    Height = height;
    PostProcessing = postProcessing;
    Mask = MemoryHelper::Allocate2D<float>(Width, Height);
}

FilterMask::~FilterMask()
{
    MemoryHelper::Deallocate2D(Mask, Height);
}

FilterMask* FilterMask::From(float mask[][PredefinedMaskSize], int width, int height, PostProcessingType postProcessing)
{
    FilterMask* filterMask = new FilterMask(width, height, postProcessing);

    for(int y = 0; y < height; y++)
    {
        for(int x = 0; x < width; x++)
        {
            filterMask->Mask[y][x] = mask[y][x];
        }
    }

    return filterMask;
}